package shapes;

import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;

/**
 * Cette classe contient les informations pour les objets
 * de type Ovale et Cercle
 * @author Maria Garcia Carrasco et Andrew Bolduc
 */

public class Oval extends AbstractShape {
	
	/**
	 * @param shapeID
	 * @param shape
	 * @param color
	 * @param xOrigin
	 * @param yOrigin
	 * @param xRadius
	 * @param yRadius
	 */
	public Oval(int shapeID, String shape, Color color, int xOrigin, int yOrigin, int secondX, int secondY) {
		super(shapeID, shape, color, xOrigin, yOrigin, secondX, secondY);
	}

	/**
	 * @return
	 */
	/*public int getSecondX() {
		return super.getSecondX();
	}*/

	/**
	 * @return
	 */
	/*public int getSecondY() {
		return super.getSecondY();
	}*/
	
	public double getArea(){
		return /*(Math.PI * Math.sqrt((Math.pow((xOrigin - ), 2)) + (Math.pow((yOrigin), 2))) * Math.sqrt((Math.pow((xOrigin), 2)) + (Math.pow((yOrigin), 2))))*/2.0;
	}

	/* (non-Javadoc)
	 * @see shapes.AbstractShape#draw(java.awt.Graphics)
	 */
	@Override
	public void draw(Graphics graphics) {
		graphics.setColor(this.getColor());
		graphics.fillOval(super.getxCoord(), super.getyCoord(), super.getSecondX(), super.getSecondY());
		graphics.setColor(Color.BLACK);
		graphics.drawOval(super.getxCoord(), super.getyCoord(), super.getSecondX(), super.getSecondY());
	}

	@Override
	public float area() {
		float area = (float)(Math.PI * super.getSecondX() * super.getSecondY());
		return area;
	}

	@Override
	public int getDistance() {
		if((getSecondX() * 2) > (getSecondY() * 2)) {
			return getSecondX();
		}
		else {
			return getSecondY();
		}
	}

	/*public void setxRadius(int xRadius) {
		super.setSecondX(xRadius);
	}

	public void setyRadius(int yRadius) {
		super.setSecondX(yRadius);
	}*/

}